<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
  <script>
    // 实现一个函数makeAdder，接受一个数字作为参数，返回一个新的函数，该函数可以将传入的参数与makeAdder函数的参数进行相加并返回结果

    const makeAdder = function (a) {

      const fn = function(b) {
        return a + b
      }
      
      return fn
    }

    //实现以下效果
    const addFive = makeAdder(5);
    console.log(addFive(10)); // 15
    console.log(addFive(20)); // 25
  </script>
</body>
</html>